/**
 * Created by arkin on 7/28/15.
 */
$(function(){
   $("input[type='submit']").click(function(){

      var i=$("input[name='num']").val();
       $('.table').load(location.href + " .table");
       $.ajax({
           type:"post",
           url:url,
           data:{num:i},
           dataType:"json",
           success:function(data){
               //console.log(data);

             $(".table").find(".na").append(
             "<td>"+data['id']+"</td>" +
             "<td>"+data['student_number']+"</td>" +
             "<td>"+data['test_number']+"</td>"+
             "<td>"+data['class']+"</td>"+
             "<td>"+data['student_name']+"</td>"+
             "<td>"+data['math_num']+"</td>"+
             "<td>"+data['language_num']+"</td>"+
             "<td>"+data['chines_num']+"</td>"+
             "<td>"+data['politics_num']+"</td>"+
             "<td>"+data['history_num']+"</td>"+
             "<td>"+data['geography_num']+"</td>"+
             "<td>"+data['biology_num']+"</td>"+
             "<td>"+data['chemistry_num']+"</td>"+
             "<td>"+data['physics_num']+"</td>"+
             "<td>"+data['eligible_subjects']+"</td>"+
             "<td>"+data['total_points']+"</td>"+
             "<td>"+data['average']+"</td>"+
             "<td>"+data['class_level']+"</td>"+
             "<td>"+data['school_level']+"</td>"
             );

               //console.log(document.getElementsByClassName('na').child());

           }
       })





   })
});